package com.opencloud.tenant.admin.api.controller;

import com.opencloud.base.client.model.AuthorityMenu;
import com.opencloud.common.model.ResultBody;
import com.opencloud.tenant.admin.api.service.feign.BaseTenantServiceClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "租户用户信息", tags = "租户用户信息")
@RestController
public class CurrentUserInfoController {


    @Autowired
    private BaseTenantServiceClient baseTenantServiceClient;


    @ApiOperation(value = "获取当前登录租户已分配菜单权限", notes = "获取当前登录租户已分配菜单权限")
    @GetMapping("/tenant/user/menu")
    public ResultBody<List<AuthorityMenu>> findAuthorityMenu() {
        ResultBody<List<AuthorityMenu>> result = baseTenantServiceClient.findAuthorityMenu();
        return ResultBody.ok().data(result.getData());
    }


}
